package com.weaver.client;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableEurekaClient
@RestController
@RefreshScope
public class ClientApplication {

	public static void main(String[] args) {
        System.out.println("start");
		SpringApplication.run(ClientApplication.class, args);
        System.out.println("start finish");
	}

	@Value("${foo}")
	String foo;
	@RequestMapping("/hi")
	public String home(@RequestParam String name)
	{
		return "hi " + name + ",i am from port:" + foo;
	}
	@RequestMapping(value = "/hi2")
	public String hi2(){
		return foo;
	}


}
